# 单例模式
# 单例模式
# 单例模式

class Singleton(object):
    obj = None

    def __new__(cls, *args, **kwargs):
        print("这是new 方法")

        if cls.obj == None:
            cls.obj = super().__new__(cls)
            return
        return cls.obj


sin = Singleton()
print(id(sin))
sin1 = Singleton()
print(sin1)
sin2 = Singleton()
print(sin2)
sin3 = Singleton()
print(sin3)
sin4 = Singleton()
print(sin4)
